package com.dsdl.chatapp.common.utils.socket;

/**
 * Created by zzg on 2016/8/3.
 */
public interface ISocketManager {
    /**
     * 接收消息监听
     */
    interface ReceiveListener{
        void receiverSuccess(String chatMsg);
    }

    /**
     * 发送消息回调
     */
    interface SendCallBack{
        void begin();
        void success(SocketPacket sendPacket);
        void error(String errorMsg);
    }

    /**
     * 建立连接
     * @param receiveListener 消息接收器监听
     */
    void connect(ReceiveListener receiveListener);

    /**
     * 发送实体消息
     * @param socketPacket 发送的数据包
     * @param callBack 发送回调
     */
    void sendMessage(SocketPacket socketPacket,SendCallBack callBack);

}
